
/*************************************************************************
* Copyright (c) 2008, ShenZhen Coship Electronic Ltd Co.
* All rights reserved.
* 
* File Name:		COSHIPH264Decode.h
* Summary:			interface for the CCOSHIPH264Decode class.
* 
* Current Version:	1.0
* Author(s):
/------------------------------------------------------------------------/
revision			author				reason					date
1.0					Ding Ning			Initialize Version		2008-6-18
/------------------------------------------------------------------------/
*************************************************************************/

#if !defined(AFX_COSHIPH264DECODE_H__7B734576_E800_46FA_8009_0BC3543669B0__INCLUDED_)
#define AFX_COSHIPH264DECODE_H__7B734576_E800_46FA_8009_0BC3543669B0__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "ICodec.h"
#include "../inc/DecBuf.h"
#include "../inc/H264DecSDK.h"

class CCOSHIPH264Decode : public ICodec
{
public:
	CCOSHIPH264Decode();
	virtual ~CCOSHIPH264Decode();
public:
	virtual BOOL Init(const char* pbuf, int len);
	virtual void Destroy();
	virtual int GetWidth() {return m_nWidth;};
	virtual int GetHeight() {return m_nHeight;};
	virtual int GetBPP() {return 24;};
	virtual BOOL Decode(const char* pbuf, int len, int subLen = 0);
	virtual void InitPicInfo();
	virtual char* GetPicBuff() {return (char*)m_pPic;};

private:
	H264DECSESSION	m_hH264;
	DecBuf*			m_pDecBuf;
	int				m_nWidth;
	int				m_nHeight;
	BOOL			m_bInited;
	BOOL			m_bInitBufed;
	PicInfo*		m_pPic;
	unsigned char*  m_ph264data;
	int				m_n264datasize;
};

#endif // !defined(AFX_COSHIPH264DECODE_H__7B734576_E800_46FA_8009_0BC3543669B0__INCLUDED_)
